<?php
function getDatePicker($url_code_base, $name_component){
    echo '<link rel="stylesheet" type="text/css" href="'.$url_code_base.'codebase/dhtmlxcalendar.css">'.
    '<link rel="stylesheet" type="text/css" href="'.$url_code_base.'codebase/skins/dhtmlxcalendar_dhx_skyblue.css">'.
    '<script type="text/javascript" src="'.$url_code_base.'codebase/dhtmlxcalendar.js"></script>'.
    '<script type="text/javascript"> var myCalendar; function doOnLoad() {myCalendar = new dhtmlXCalendarObject(["'.$name_component.'"]);}</script>'.
    '<input type="text" id="'.$name_component.'" name="'.$name_component.'" size="10" readonly/>'.
    '<script type="text/javascript">doOnLoad();</script>';
}
function getVarDatePicker($url_code_base, $name_component, $id_component=''){
    $id = $id_component==''?$name_component:$id_component;
    return '<link rel="stylesheet" type="text/css" href="'.$url_code_base.'codebase/dhtmlxcalendar.css">'.
    '<link rel="stylesheet" type="text/css" href="'.$url_code_base.'codebase/skins/dhtmlxcalendar_dhx_skyblue.css">'.
    '<script type="text/javascript" src="'.$url_code_base.'codebase/dhtmlxcalendar.js"></script>'.
    '<script type="text/javascript"> var myCalendar; function doOnLoad() {myCalendar = new dhtmlXCalendarObject(["'.$id.'"]);}</script>'.
    '<input type="text" id="'.$id.'" name="'.$name_component.'" size="10" readonly/>'.
    '<script type="text/javascript">doOnLoad();</script>';
}
?>
